package com.heisen.base.lock;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author sen
 * @description  锁对象抽象
 * @date 2024/1/18 9:37
 */

@AllArgsConstructor
public class ZLock implements AutoCloseable {
    @Getter
    private final Object lock;

    private final DistributedLock locker;

    @Override
    public void close() throws Exception {
        locker.unlock(lock);
    }
}
